<?php

namespace common\validate;

class GlobalNotice extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    // Create
    public function sceneCreate(): GlobalNotice
    {
        return $this
            ->append('data.global_notice.type', 'require|in:1,2,3,4,5,6,7,8,9')
            ->append('data.global_notice.is_top', 'require|in:0,1')
            ->append('data.global_notice.title', 'require')
            ->append('data.global_notice.content', 'require');
    }

    // GetCount
    public function sceneGetCount(): GlobalNotice
    {
        return $this
            ->append('param', 'array')
            ->append('param.filter', 'array');
    }

    // List
    public function sceneList(): GlobalNotice
    {
        return $this
            ->append('param', 'array')
            ->append('param.filter', 'array')
            ->append('param.page', 'array');
    }
}
